/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simpSync.model;

import javafx.scene.Node;
import javafx.scene.layout.Pane;

/**
 *
 */
public class Link {

    private String condition;
    private String action;
    private String source;
    private String target;
    private String width;
    private String height;
    private String key;

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public String getCondition() {
        return condition;
    }

    public void setCondition(String condition) {
        this.condition = condition;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }
    
    
    public void assign(Pane pane, SimpleSync ss) {

        Node source = ss.getNode(getSource());
        Node target = ss.getNode(getTarget());

        if (getCondition().equals("onBegin")) {
            if (getAction().equals("start")) {
                //quando  o source inicia, iniciar o target
            }
            if (getAction().equals("stop")) {
                //quando  o source inicia, parar o target
            }
            if (getAction().equals("setSize")) {
                //quando  o source inicia, redimensionar o target
            }
        }
        if (getCondition().equals("onEnd")) {
            if (getAction().equals("start")) {
                //quando  o source termina, iniciar o target
            }
            if (getAction().equals("stop")) {
                //quando  o source termina, parar o target
            }
            if (getAction().equals("setSize")) {
                //quando  o source termina, redimensionar o target
            }
        }
        if (getCondition().equals("onKey")) {
            if (getAction().equals("start")) {
                //quando  o source tecla, iniciar o target
            }
            if (getAction().equals("stop")) {
                //quando  o source tecla, parar o target
            }
            if (getAction().equals("setSize")) {
                //quando  o source tecla, redimensionar o target
            }
        }

    }
    
}
